package com.fast.mybatis.mapper;

import java.util.List;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.springframework.stereotype.Repository;

import com.fast.mybatis.sqlprovider.MybatisProvider;
@Repository
public interface MybatisMapper<T> {

    @UpdateProvider(type = MybatisProvider.class, method = "updateByPrimaryKey")
    public Integer updateByPrimaryKey(T t);
   
    @UpdateProvider(type = MybatisProvider.class, method = "updateByPrimaryKeySelective")
    public Integer updateByPrimaryKeySelective(T t);

    @InsertProvider(type = MybatisProvider.class, method = "insertSelective")
    public Integer insertSelective(T t);

    @InsertProvider(type = MybatisProvider.class, method = "insert")
    public Integer insert(T t);
    
    @InsertProvider(type = MybatisProvider.class, method = "insertList")
    public Integer insertList(List<T> list);
    
    @InsertProvider(type = MybatisProvider.class, method = "insertListSelective")
    public Integer insertListSelective(List<T> list);

    @DeleteProvider(type = MybatisProvider.class, method = "deleteByPrimaryKey")
    public Integer deleteByPrimaryKey(T t);
    
    @SelectProvider(type = MybatisProvider.class, method = "selectIn")
    public List<T> selectIn(List<T> t);

    @SelectProvider(type = MybatisProvider.class, method = "countAll")
    public Integer countAll(T t);

    @SelectProvider(type = MybatisProvider.class, method = "selectByPrimaryKey")
    public T selectByPrimaryKey(T t);

    @SelectProvider(type = MybatisProvider.class, method = "select")
    public List<T> select(T t);

}
